package com.example.m1;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class Producer {
    @Autowired

    AmqpTemplate t;//

    public void send() {
        // 转换并发送
        t.convertAndSend("helloworld", "Hello world!! "+System.currentTimeMillis());
        System.out.println("消息已发送");
    }


}
